<html>
<head><meta charset="utf-8"><title>How to declare new langauge feature? · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F.html">How to declare new langauge feature?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="171375020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20to%20declare%20new%20langauge%20feature%3F/near/171375020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F.html#171375020">(Jul 21 2019 at 14:38)</a>:</h4>
<p>In <a href="https://github.com/rust-lang/rust/pull/62848" target="_blank" title="https://github.com/rust-lang/rust/pull/62848">https://github.com/rust-lang/rust/pull/62848</a>, I am trying to remove <code>char::is_xid_start</code> / <code>char::is_xid_continue</code> from libcore. The problem I face is that these two methods are the only one annotated with <code>feature = "rustc_private"</code>, so, If I remove them, rustc complains that it knows no such feature. </p>
<p>I <em>think</em> I need to make <code>rustc_private</code> a language feature, as opposed to library features. I've tried to add it to <code>libsyntx/feature_gate</code>, as <code>(active, rustc_private, "1.0.0", None, None),</code>, but I still get "error[E0635]: unknown feature <code>rustc_private</code>". </p>
<p>What should I do? :)</p>



<a name="171375244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20to%20declare%20new%20langauge%20feature%3F/near/171375244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F.html#171375244">(Jul 21 2019 at 14:45)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> I presume you'll want <code>#[cfg_attr(bootstrap, unstable(...))]</code>since stage1+ will know about it via libsyntax but before then we won't</p>



<a name="171375426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20to%20declare%20new%20langauge%20feature%3F/near/171375426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F.html#171375426">(Jul 21 2019 at 14:50)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span>  doesn't seem to help:</p>
<div class="codehilite"><pre><span></span>error[E0635]: unknown feature `rustc_private`
   --&gt; src/libstd/lib.rs:309:32
    |
309 | #![cfg_attr(bootstrap, feature(rustc_private))]
    |                                ^^^^^^^^^^^^^
</pre></div>


<p>I am also not sure if it <em>should</em> help. My understanding is that the main thing that <code>rustc_private</code> unlocks is using compler-private crates. If I don't activate that feature, I'll get missing crates errors?</p>



<a name="171375507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20to%20declare%20new%20langauge%20feature%3F/near/171375507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F.html#171375507">(Jul 21 2019 at 14:53)</a>:</h4>
<p>hm, is that during stage 1 or stage 0 compilation?</p>



<a name="171375513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20to%20declare%20new%20langauge%20feature%3F/near/171375513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F.html#171375513">(Jul 21 2019 at 14:53)</a>:</h4>
<p>missing crates, no, but a bunch of feature gate warnings</p>



<a name="171375521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20to%20declare%20new%20langauge%20feature%3F/near/171375521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F.html#171375521">(Jul 21 2019 at 14:54)</a>:</h4>
<p>it might be that we're not properly hooking into rustc-private via <code>-Zforce-unstable-if-unmarked</code></p>



<a name="171375563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/How%20to%20declare%20new%20langauge%20feature%3F/near/171375563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/How.20to.20declare.20new.20langauge.20feature.3F.html#171375563">(Jul 21 2019 at 14:54)</a>:</h4>
<p>that is, the new rustc_private</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>